package com.sgb.kjwl.view.ui.adapter.packers;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.FindJobEntity;
import com.sgb.kjwl.model.entity.ServicesCompanyEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import com.swgk.core.util.DateUtils;

import java.util.List;

public class ServicesCompanyAdapter extends BaseRecycleAdapter<ServicesCompanyEntity> {


    public ServicesCompanyAdapter(Context context, List<ServicesCompanyEntity> datas) {
        super(context, R.layout.item_services_company, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, ServicesCompanyEntity servicesCompanyBean) {
        holder.setBinding(BR.viewModel, servicesCompanyBean);
        String time = servicesCompanyBean.getEstablishmentDate();
        if (time != null && !TextUtils.isEmpty(time)) {
            TextView tvTime = holder.itemView.findViewById(R.id.tv_time);
            tvTime.setText(DateUtils.timestampToDate(Long.parseLong(time)));
        }
    }
}
